package com.ifeng.igps.model;

import java.util.Date;

import android.os.Parcel;
import android.os.Parcelable;

public class GPSPoint implements Parcelable {

	double lat;
	double lng;
	float speed;
	String user;
	Date time;
	short mode;
	short purpose;
	int segmentID;
	float accuracy;
	int GPSorNetwork;

	@Override
	public int describeContents() {
		return 0;
	}

	@Override
	public void writeToParcel(Parcel dest, int flags) {
		dest.writeDouble(lat);
		dest.writeDouble(lng);
		dest.writeFloat(speed);
		dest.writeString(user);

		dest.writeInt(mode);
		dest.writeInt(purpose);
		dest.writeInt(segmentID);
		dest.writeFloat(accuracy);
		dest.writeInt(GPSorNetwork);
	}

	private GPSPoint(Parcel in) {
		lat = in.readDouble();
		lng = in.readDouble();
		speed = in.readFloat();
		user = in.readString();

		mode = (short) in.readInt();
		purpose = (short) in.readInt();
		segmentID = in.readInt();
		accuracy = in.readFloat();
		GPSorNetwork = in.readInt();
	}

	public GPSPoint() {

	}

	public static final Creator<GPSPoint> CREATOR = new Parcelable.Creator<GPSPoint>() {
		public GPSPoint createFromParcel(Parcel in) {
			return new GPSPoint(in);
		}

		public GPSPoint[] newArray(int size) {
			return new GPSPoint[size];
		}
	};

	public int getGPSorNetwork() {
		return GPSorNetwork;
	}

	public void setGPSorNetwork(int gPSorNetwork) {
		GPSorNetwork = gPSorNetwork;
	}

	public float getAccuracy() {
		return accuracy;
	}

	public void setAccuracy(float accuracy) {
		this.accuracy = accuracy;
	}

	public int getSegmentID() {
		return segmentID;
	}

	public void setSegmentID(int segmentID) {
		this.segmentID = segmentID;
	}

	public float getSpeed() {
		return speed;
	}

	public void setSpeed(float speed) {
		this.speed = speed;
	}

	public String getUser() {
		return user;
	}

	public double getLat() {
		return lat;
	}

	public void setLat(double lat) {
		this.lat = lat;
	}

	public double getLng() {
		return lng;
	}

	public void setLng(double lng) {
		this.lng = lng;
	}

	public void setUser(String user) {
		this.user = user;
	}

	public Date getTime() {
		return time;
	}

	public void setTime(Date time) {
		this.time = time;
	}

	public short getMode() {
		return mode;
	}

	public void setMode(short mode) {
		this.mode = mode;
	}

	public short getPurpose() {
		return purpose;
	}

	public void setPurpose(short purpose) {
		this.purpose = purpose;
	}

}
